<?php

/**
 * This is the model class for table "industripenerimaan".
 *
 * The followings are the available columns in table 'industripenerimaan':
 * @property integer $ip_id
 * @property string $ip_kodejenis
 * @property integer $ip_nilai
 * @property integer $ip_selisih
 * @property integer $ip_list
 * @property integer $ip_makloon
 * @property integer $ip_lain
 * @property integer $ip_jumlah
 * @property integer $ip_tahun
 */
class Industripenerimaan extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Industripenerimaan the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'industripenerimaan';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ip_nilai, ip_selisih, ip_list, ip_makloon, ip_lain, ip_jumlah, ip_tahun', 'numerical', 'integerOnly'=>true),
			array('ip_kodejenis', 'length', 'max'=>128),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ip_id, ip_kodejenis, ip_nilai, ip_selisih, ip_list, ip_makloon, ip_lain, ip_jumlah, ip_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ip_id' => 'Ip',
			'ip_kodejenis' => 'Jenis Industri',
			'ip_nilai' => 'Nilai Barang yang Dihasilkan',
			'ip_selisih' => 'Selisih Nilai',
			'ip_list' => 'List yang Dijual',
			'ip_makloon' => 'Penerimaan Makloon',
			'ip_lain' => 'Penerimaan Lainnya',
			'ip_jumlah' => 'Jumlah',
			'ip_tahun' => 'Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ip_id',$this->ip_id);
		$criteria->compare('ip_kodejenis',$this->ip_kodejenis,true);
		$criteria->compare('ip_nilai',$this->ip_nilai);
		$criteria->compare('ip_selisih',$this->ip_selisih);
		$criteria->compare('ip_list',$this->ip_list);
		$criteria->compare('ip_makloon',$this->ip_makloon);
		$criteria->compare('ip_lain',$this->ip_lain);
		$criteria->compare('ip_jumlah',$this->ip_jumlah);
		$criteria->compare('ip_tahun',$this->ip_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}